import request from '@/utils/request.js'

const roleApi = {
    list(roleQuery) {
        return request.get('/admin/role/list', {params: roleQuery})
    },
    deleteById(id) {
        return request.delete(`/admin/role/deleteById/${id}`)
    },
    deleteAll(ids) {
        return request.delete(`/admin/role/deleteAll/${ids}`)
    },
    add(role) {
        //admin以JSON形式传递到后台
        return request.post('/admin/role/add', role)
    },
    selectById(id) {
        return request.get(`/admin/role/selectById/${id}`)
    },
    update(role) {
        return request.put('/admin/role/update', role)
    }
}

export default roleApi